<HTML>
<HEAD>
<TITLE>Command History Object Documentation</TITLE>
</HEAD>
<BODY>
<A HREF="#toc">Table of Contents</A><P>
_________________________________________________________________
<P>

<H2><A NAME="sect1" HREF="#toc1"><B>NAME</B></A></H2>
ch_open - create and manipulate a command history object.
<P>

<H2><A NAME="sect2" HREF="#toc2"><B>SYNOPSIS</B></A></H2>
<B>ch_open</B> [<I>chName</I>]
<P>

<H2><A NAME="sect8" HREF="#toc8"><B>DESCRIPTION</B></A></H2>
The <B>ch_open</B> command creates a new command history object
(given by the <I>chName</I> argument).
The <B>ch_open</B> command returns its <I>chName</I> argument.
At the time this command is invoked, there must not exist a
command history object named <I>chName</I>.
<P>

<H2><A NAME="sect9" HREF="#toc9"><B>METHODS</B></A></H2>
The <B>ch_open</B> command creates a new Tcl command whose name
is <I>chName</I>. This command may be used to invoke various
operations on the command history object. It has the following general
form:
<P>
<I>chName</I> <I>option</I> ?<I>arg</I> <I>arg</I> ...?
<P>
<I>Option</I> and the <I>arg</I>s determine the exact behavior of the command.
The following commands are possible for command history objects:
<P>
<DL>
<DT><I>chName</I> <A NAME="add"><B>add</B></A> <I>command_string</I></DT>
<DD>Add a command to the history and reset the current
command pointer.</DD>
<DT><I>chName</I> <A NAME="curr"><B>curr</B></A></DT>
<DD>Return the current command in the history.</DD>
<DT><I>chName</I> <A NAME="history"><B>history</B></A></DT>
<DD>Return the entire history.</DD>
<DT><I>chName</I> <A NAME="next"><B>next</B></A></DT>
<DD>Return the next command in the history making that
the current command.</DD>
<DT><I>chName</I> <A NAME="prev"><B>prev</B></A></DT>
<DD>Return the previous command in the history making that
the current command.</DD>
<P>
</DL>

<H2><A NAME="sect16" HREF="#toc16"><B>EXAMPLE</B></A></H2>
The following sequence creates a command history object,
adds commands and traverses the history.
<P>
cwish> ch_open ch
<BR>
ch
<BR>
cwish> ch add "cmd1"
<BR>
cwish> ch add "cmd2"
<BR>
cwish> ch prev
<BR>
cmd2
<BR>
cwish> ch prev
<BR>
cmd1
<BR>
cwish> ch curr
<BR>
cmd1
<BR>
cwish> ch add "cmd3"
<BR>
cwish> ch prev
<BR>
cmd3
<BR>
cwish> ch prev
<BR>
cmd2
<BR>
cwish> ch next
<BR>
cmd3
<BR>
cwish> ch next
<BR>
cwish> ch history
<BR>
cmd1
<BR>
cmd2
<BR>
cmd3
<P>

<H2><A NAME="sect17" HREF="#toc17"><B>ACKNOWLEDGMENTS:</B></A></H2>

Mark L. Ulferts &lt;mulferts@austin.dsccc.com&gt;
<PRE>        Basic layout for documenting classes.</PRE>
<P>
Glenn Durfee
<PRE>        Original implementation of command history in MGED.</PRE>
<P>

<H2><A NAME="sect18" HREF="#toc18"><B>AUTHOR</B></A></H2>
<P>
Robert G. Parker
<P>

<HR><P>
<A NAME="toc"><B>Table of Contents</B></A><P>
<UL>
<LI><A NAME="toc1" HREF="#sect1">NAME</A></LI>
<LI><A NAME="toc2" HREF="#sect2">SYNOPSIS</A></LI>
<LI><A NAME="toc8" HREF="#sect8">DESCRIPTION</A></LI>
<LI><A NAME="toc9" HREF="#sect9">METHODS</A></LI>
<LI><A NAME="toc16" HREF="#sect16">EXAMPLE</A></LI>
<LI><A NAME="toc17" HREF="#sect17">ACKNOWLEDGMENTS</A></LI>
<LI><A NAME="toc18" HREF="#sect18">AUTHOR</A></LI>
</UL>
</BODY>
</HTML>
